// 运营中心
import Vue from "vue";
import API from "../requestApi/contractApi";
const contract = {
  //
  getapiplantasklist: function getapiplantasklist(params) {
    let ip = `${API.apiplantasklist}?planId=${params.planId}&taskIds=${
      params.taskIds
    }&memberId=${params.memberId}&type=${params.type}`;
    return Vue.http.get(ip, {}).then(response => {
      if (response.status === 200) {
        return Promise.resolve(response.body);
      } else {
        return Promise.reject(response.data);
      }
    });
  },
  // 添加审批人
  getcontractapprovaladdapprovers: function getcontractapprovaladdapprovers(
    params
  ) {
    return Vue.http
      .post(API.contractapprovaladdapprovers, params)
      .then(response => {
        if (response.status === 200) {
          return Promise.resolve(response.body);
        } else {
          return Promise.reject(response.data);
        }
      });
  },
  // 统计总数
  getcontractapprovalstatistics: function getcontractapprovalstatistics(
    params
  ) {
    return Vue.http
      .post(API.contractapprovalstatistics, params)
      .then(response => {
        if (response.status === 200) {
          return Promise.resolve(response.body);
        } else {
          return Promise.reject(response.data);
        }
      });
  },
  // 获取企业列表
  getapicontactscontactscompanylist: function getapicontactscontactscompanylist(
    params
  ) {
    return Vue.http
      .post(API.apicontactscontactscompanylist, params)
      .then(response => {
        if (response.status === 200) {
          return Promise.resolve(response.body);
        } else {
          return Promise.reject(response.data);
        }
      });
  },
  // 获取旧审批人
  getcontractapprovaloldapprovers: function getcontractapprovaloldapprovers(
    params
  ) {
    return Vue.http
      .post(API.contractapprovaloldapprovers, params)
      .then(response => {
        if (response.status === 200) {
          return Promise.resolve(response.body);
        } else {
          return Promise.reject(response.data);
        }
      });
  },
  // 新增或编辑合同审批
  getcontractapprovalcreateorupdate: function getcontractapprovalcreateorupdate(
    params
  ) {
    return Vue.http
      .post(API.contractapprovalcreateorupdate, params)
      .then(response => {
        if (response.status === 200) {
          return Promise.resolve(response.body);
        } else {
          return Promise.reject(response.data);
        }
      });
  },
  // 再次发起合同审批
  getcontractapprovalagaincreate: function getcontractapprovalagaincreate(
    params
  ) {
    return Vue.http
      .post(API.contractapprovalagaincreate, params)
      .then(response => {
        if (response.status === 200) {
          return Promise.resolve(response.body);
        } else {
          return Promise.reject(response.data);
        }
      });
  },
  // 同意或拒绝或转交操作
  getcontractapprovalsolve: function getcontractapprovalsolve(params) {
    return Vue.http.post(API.contractapprovalsolve, params).then(response => {
      if (response.status === 200) {
        return Promise.resolve(response.body);
      } else {
        return Promise.reject(response.data);
      }
    });
  },
  // 撤销操作
  getcontractapprovalrevoke: function getcontractapprovalrevoke(params) {
    return Vue.http.post(API.contractapprovalrevoke, params).then(response => {
      if (response.status === 200) {
        return Promise.resolve(response.body);
      } else {
        return Promise.reject(response.data);
      }
    });
  },
  // 分页查待我审批的列表
  getcontractapprovalwaitedlist: function getcontractapprovalwaitedlist(
    params
  ) {
    return Vue.http
      .post(API.contractapprovalwaitedlist, params)
      .then(response => {
        if (response.status === 200) {
          return Promise.resolve(response.body);
        } else {
          return Promise.reject(response.data);
        }
      });
  },
  // 分页查我已发起的列表
  getcontractapprovallaunchlist: function getcontractapprovallaunchlist(
    params
  ) {
    return Vue.http
      .post(API.contractapprovallaunchlist, params)
      .then(response => {
        if (response.status === 200) {
          return Promise.resolve(response.body);
        } else {
          return Promise.reject(response.data);
        }
      });
  },
  // 分页查我已审批的列表
  getcontractapprovalfinishlist: function getcontractapprovalfinishlist(
    params
  ) {
    return Vue.http
      .post(API.contractapprovalfinishlist, params)
      .then(response => {
        if (response.status === 200) {
          return Promise.resolve(response.body);
        } else {
          return Promise.reject(response.data);
        }
      });
  },
  // 分页查抄送我的列表
  getcontractapprovalcopylist: function getcontractapprovalcopylist(params) {
    return Vue.http
      .post(API.contractapprovalcopylist, params)
      .then(response => {
        if (response.status === 200) {
          return Promise.resolve(response.body);
        } else {
          return Promise.reject(response.data);
        }
      });
  },
  // 编辑抄送列表是否已读
  getcontractupdateread: function getcontractupdateread(params) {
    return Vue.http.post(API.contractupdateread, params).then(response => {
      if (response.status === 200) {
        return Promise.resolve(response.body);
      } else {
        return Promise.reject(response.data);
      }
    });
  },
  // 查合同审批详情
  getcontractapprovaldetail: function getcontractapprovaldetail(params) {
    return Vue.http.post(API.contractapprovaldetail, params).then(response => {
      if (response.status === 200) {
        return Promise.resolve(response.body);
      } else {
        return Promise.reject(response.data);
      }
    });
  },
  // 新增或编辑合同归档
  getcontractfilingcreateorupdate: function getcontractfilingcreateorupdate(
    params
  ) {
    return Vue.http
      .post(API.contractfilingcreateorupdate, params)
      .then(response => {
        if (response.status === 200) {
          return Promise.resolve(response.body);
        } else {
          return Promise.reject(response.data);
        }
      });
  },
  // 查搜索关键字的历史记录
  getcontractfilingrecord: function getcontractfilingrecord(params) {
    return Vue.http.post(API.contractfilingrecord, params).then(response => {
      if (response.status === 200) {
        return Promise.resolve(response.body);
      } else {
        return Promise.reject(response.data);
      }
    });
  },
  // 清空搜索关键字历史记录
  getcontractfilingclear: function getcontractfilingclear(params) {
    return Vue.http.post(API.contractfilingclear, params).then(response => {
      if (response.status === 200) {
        return Promise.resolve(response.body);
      } else {
        return Promise.reject(response.data);
      }
    });
  },
  // 分页查归档合同列表(含：查询回收站的归档记录列表)
  getcontractfilinglist: function getcontractfilinglist(params) {
    return Vue.http.post(API.contractfilinglist, params).then(response => {
      if (response.status === 200) {
        return Promise.resolve(response.body);
      } else {
        return Promise.reject(response.data);
      }
    });
  },
  // 查归档详情
  getcontractfilingdetail: function getcontractfilingdetail(params) {
    return Vue.http.post(API.contractfilingdetail, params).then(response => {
      if (response.status === 200) {
        return Promise.resolve(response.body);
      } else {
        return Promise.reject(response.data);
      }
    });
  },
  // 移动合同归档
  getreportsentpage: function getreportsentpage(params) {
    return Vue.http.post(API.reportsentpage, params).then(response => {
      if (response.status === 200) {
        return Promise.resolve(response.body);
      } else {
        return Promise.reject(response.data);
      }
    });
  },
  // 删除合同归档
  getreportdetail: function getreportdetail(params) {
    return Vue.http.post(API.reportdetail, params).then(response => {
      if (response.status === 200) {
        return Promise.resolve(response.body);
      } else {
        return Promise.reject(response.data);
      }
    });
  },
  // 清空或删除回收站合同
  getreportcount: function getreportcount(params) {
    return Vue.http.post(API.reportcount, params).then(response => {
      if (response.status === 200) {
        return Promise.resolve(response.body);
      } else {
        return Promise.reject(response.data);
      }
    });
  },
  // 还原回收站合同
  getcontractfilingrecovery: function getcontractfilingrecovery(params) {
    return Vue.http.post(API.contractfilingrecovery, params).then(response => {
      if (response.status === 200) {
        return Promise.resolve(response.body);
      } else {
        return Promise.reject(response.data);
      }
    });
  },
  // 新建或编辑文件夹
  getcontractfoldercreateorupdate: function getcontractfoldercreateorupdate(
    params
  ) {
    return Vue.http
      .post(API.contractfoldercreateorupdate, params)
      .then(response => {
        if (response.status === 200) {
          return Promise.resolve(response.body);
        } else {
          return Promise.reject(response.data);
        }
      });
  },
  // 公司列表
  getcontractfoldercompany: function getcontractfoldercompany(params) {
    return Vue.http.post(API.contractfoldercompany, params).then(response => {
      if (response.status === 200) {
        return Promise.resolve(response.body);
      } else {
        return Promise.reject(response.data);
      }
    });
  },
  // 删除文件夹
  getstatisticscounttasklist: function getstatisticscounttasklist(params) {
    return Vue.http.post(API.statisticscounttasklist, params).then(response => {
      if (response.status === 200) {
        return Promise.resolve(response.body);
      } else {
        return Promise.reject(response.data);
      }
    });
  },
  // 文件夹列表
  getcontractfolderlist: function getcontractfolderlist(params) {
    return Vue.http.post(API.contractfolderlist, params).then(response => {
      if (response.status === 200) {
        return Promise.resolve(response.body);
      } else {
        return Promise.reject(response.data);
      }
    });
  },
  // 移动文件夹
  getcontractfoldermove: function getcontractfoldermove(params) {
    return Vue.http.post(API.contractfoldermove, params).then(response => {
      if (response.status === 200) {
        return Promise.resolve(response.body);
      } else {
        return Promise.reject(response.data);
      }
    });
  },
  // 查合同类别列表
  getcontractcategorylist: function getcontractcategorylist(params) {
    return Vue.http.post(API.contractcategorylist, params).then(response => {
      if (response.status === 200) {
        return Promise.resolve(response.body);
      } else {
        return Promise.reject(response.data);
      }
    });
  },
  // 设置权限
  getcontractpermissionset: function getcontractpermissionset(params) {
    return Vue.http.post(API.contractpermissionset, params).then(response => {
      if (response.status === 200) {
        return Promise.resolve(response.body);
      } else {
        return Promise.reject(response.data);
      }
    });
  },
  // 获取权限详情
  getcontractpermissionget: function getcontractpermissionget(params) {
    return Vue.http.post(API.contractpermissionget, params).then(response => {
      if (response.status === 200) {
        return Promise.resolve(response.body);
      } else {
        return Promise.reject(response.data);
      }
    });
  }
};
export default contract;
